package com.acoffee.java.DynamicProxy;

/**
 * @author acoffee
 * @create 2021-11-15 14:07
 */
public class TestProxy {
    public static void main(String[] args) {
        UserServiceImpl userService = new UserServiceImpl();

//        JdkDynamic jdkDynamic = new JdkDynamic();
//        UserService proxyObject = (UserService) jdkDynamic.getProxyObject(userService);

        CglibDynamic cglibDynamic = new CglibDynamic();
        UserServiceImpl proxyObject = (UserServiceImpl) cglibDynamic.getProxyObject(userService);
        proxyObject.addOne();
        proxyObject.deleteOne();
    }
}
